package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"mall/api/bilinadmin"
)

func main() {
	//ch := make(chan int)
	//
	//go func() {
	//	v := <-ch
	//	fmt.Println(v)
	//}()
	//ch <- 1
	//fmt.Println("2")

	conn, err := grpc.Dial("10.2.1.12:7778", grpc.WithInsecure(), grpc.WithBlock())
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	defer func() {
		_ = conn.Close()
	}()
	client := bilinadmin.NewBilinAdminClient(conn)
	resp, err := client.GetStoresByGeo(context.Background(), &bilinadmin.GetStoresByGeoReq{
		BrandId:   52,
		Latitude:  30.41875,
		Longitude: 120.298501,
	})
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	fmt.Println(resp.PlatStores)
}
